fs.readdir(SYNCDIR, function(err1, files) {
  var filesOnly = [];

  if(!err1) {

    for(var i = 0; i < files.length; i++) {

      (function(i) {
        var imgFilePath = SYNCDIR + '/' + files[i];
        fs.stat(imgFilePath, function(stat){
          if (stat.isFile()){
            filesOnly[i] = stat;
          }
        });
      })(i);

    }
  }
});
var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};
var configs = {};

async.forEachOf(obj, function (value, key, callback) {
  fs.readFile(__dirname + value, "utf8", function (err, data) {
    if (err) return callback(err);
    try {
      configs[key] = JSON.parse(data);
    } catch (e) {
      return callback(e);
    }
    callback();
  });
}, function (err) {
  if (err) console.error(err.message);
  // configs is now a map of JSON data
  doSomethingWith(configs);
});
